package appconfig

import (
	"github.com/spf13/viper"
	"log"
)

type Config struct {
	Mysql struct {
		User     string
		Pass     string
		Host     string
		Port     int
		Database string
	}
	Redis struct {
		Pass string
		Port int
		Host string
	}
}

var ConfigData Config

func Init() {
	viper.SetConfigFile("appconfig/config.yaml")
	viper.ReadInConfig()
	viper.Unmarshal(&ConfigData)
	log.Println(ConfigData)
}
